home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
CIncludesTool
/
original version
/
Instructions
< prev
Wrap
Text File
|
1990-07-30
|
4KB
|
117 lines
Instructions for use of CIncludesTool -- John Jeppson
Changes in this version - 07/29/90.
1. Adds ability to open CIncludes header file where target word is defined.
2. Corrects bug which intermittently caused "reformat" instruction to fail.
Description:
CIncludesTool is an MPW tool which locates a C or C++ identifier in
the {CIncludes} file where it is first used. The tool then generates
the appropriate "#include <file>" instruction for your program. A
dictionary of all the indentifiers is generated and stored in
your system folder, so using the tool is quite efficient.
The tool has three main actions:
1. Generate "#include <file>" instruction for the selected identifier.
2. Consolidate several #include instructions, eliminating dependencies.
3. Open the CInclude file to the spot where an identifier is defined.
*** thanks to Daniel Grassi for this part ***
CIncludesTool is supplied as source code which you may modify and use
on your own system. The accompanying source code files are Copyright
1990 by John Jeppson and may not be sold or distributed for profit
without my permission.
Installation:
1. Build "CIncludesCode" using the enclosed ".make" file.
2. Drag the resulting "CIncludesCode" file to your MPW {tools} folder.
3. Drag the script file "CIncludesTool" to your MPW {tools} folder.
4. From your worksheet execute: "CIncludesTool -m". This command generates
the indentifier dictionary and saves it in your system folder in a
file called "CIncludesData". If you change the files in your
{CIncludes} folder then repeat this step.
5. Create menu/keyboard commands for the tool by placing the following
instructions in your "UserStartup" file:
AddMenu Edit 'CIncludesLocate/0' 'CIncludesTool -f'
AddMenu Edit 'CIncludesReformat/9' 'CIncludesTool -i'
AddMenu Edit 'CIncludesOpenHeader/8' 'CIncludesTool -d'
Note that these commands use Cmd-0, Cmd-9, and Cmd-8 as the keyboard
equivalents. Change them to whatever you want. (I actually use
Cmd-D instead of Cmd-8, replacing the "open selection" command in
the file menu.)
Usage:
When the C or C++ compiler complains that a Mac toolbox name or
other "system" identifier is undefined, select the indentifier
in your program text and press "Cmd-0". The appropriate "#include"
instruction will be inserted at the top of your program text file in
the active window.
A series of "#include" instructions may be condensed by eliminating
duplicates and dependencies. Just select all the lines containing
"#include" instructions and press Cmd-9.
To open the appropriate header file where something is defined, select
the identifier and press Cmd-8.
Internals:
The file "CIncludesTool" is an MPW script which must be called with
a single parameter:
-m Rebuilds the CIncludes identifier dictionary.
-f Locates selection from active window.
-i Reformates "include" statements in {Active}.§
-d Opens header file where selection is defined.
"CIncludesTool" script, in turn, calls "CIncludesCode", an MPW tool
written in C, supplying various parameters. {1} must be:
-m Rebuilds the CIncludes identifier dictionary file
-v Checks if {2} is a valid C identifier string
-f Attempts to locate {2} in identifier dictionary
-i Reformates "include" statements in {Active}.§
-d Gets file name and position where selection is defined.
"CIncludesCode" writes error messages, if any, to StdErr.
Also:
(-m) writes progress messages to StdErr so that
they will be displayed when written.
(-f) writes output to {Active} window at the window top (or
to the next line if you comment out the appropriate
line in "CIncludesTool" script).
(-i) replaces selection in active window with list of
include statements. Any comments following
previous include statements will be lost.
"CIncludesCode" also returns one of the following status codes:
0 Okay
1 Bad Parameters
2 Invalid identifier string in {2}
3 Out of Memory
4 Unable to locate identifier {2} in dictionary